package com.jt.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xxh
 * @date 2021/6/20 21:48
 */

@RestController
public class PortController {

    @Value("${server.port}")
    private Integer port;

    /**
     * 动态获取端口号(getPort)
     */
    @RequestMapping("/getPort")
    public String getPort(){

        return "当前端口号为：" + port;
    }
}
